package sketch;

import javax.swing.*;
import java.net.*;

/**
 * 
 * @author Indrojeet Mondal
 * @version 0.1
 *
 */
class HelpDialog extends JDialog
{
	private JEditorPane ep = new JEditorPane();
	
	public HelpDialog(JFrame parent)
	{
		super(parent, "Help", false);
		setSize(500, 500);
		
		this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
		
		try {
			URL url = getClass().getResource("help.html");
			
			ep.setPage(url);
		}
		catch (Exception e) {
			JOptionPane.showMessageDialog(this, "Couldn't load help file", JGraphSketch.appName, 
					JOptionPane.ERROR_MESSAGE);
		}
		ep.setEditable(false);
		JScrollPane pane = new JScrollPane(ep);
		add(pane);
	}
}
